package com.fintech.third.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fintech.third.dao.OrderStatusPreseMapper;
import com.fintech.third.model.ErrorInfo;
import com.fintech.third.model.OrderStatus;

@Service("OrderStatusPrese")
public class OrderStatusPreseImpl implements OrderStatusPreseService {

	@Autowired
	OrderStatusPreseMapper orderStatusPreseMapper;

	@Override
	public ErrorInfo orderStatusPreser(OrderStatus orderStatus) {
		ErrorInfo errorInfo = new ErrorInfo();
		int result = orderStatusPreseMapper.insertOrderStatus(orderStatus);
		if (result > 0) {
			errorInfo.setErrorMsg("插入成功");
			errorInfo.setErrorCode(0);
			Thread t = new Thread(new Runnable() {
				public void run() {

				}
			});
			t.start();
		} else {
			errorInfo.setErrorMsg("插入失败");
			errorInfo.setErrorCode(-1);
		}
		return errorInfo;
	}

}
